% function estimaOutputStructures

% This function saves 5 structures that can then easily be loaded with all 
% information 
% names
% KFStru 
% model 
% report 
% sampleSS

% *nameStru* 
% states 
% shocks 
% observables 
% data 
names.states=stateNames; 
names.shocks=shockNames; 
names.observables=Znames; 
names.steady=ssnames; 
names.data=Ynames; 
names.param=parnames; 

%% Call to the KFilter is of the form 
% *model 
model.handle=funcmod; 
model.param =parMode; 
model.steady=ssvec; 
model.addsol=addsol; 
model.handleFilter=addsol.funcKfilter; 
model.data=Y; 
model.trainVec=trainvec; 
model.path=outpath;

model.caseFilter      =addsol.caseFilter; 
model.flags.mixedFreq =addsol.flag_mixfreq; 
model.logPost=logPostMat(1,2);
model.logLikel=logLikelMat(1,2); 
model.solveOptions=solveopt; 
model.handleLikel=addsol.funcLikel; 


model.GG=GG; 
model.RR=RR; 
model.cholV=SDX; 
model.CC=CONS; 
model.ZZ=ZZ; 

sampleStru.vector=sampleSS.sampleVec; 
sampleStru.cell  =sampleSS.sampleCell; 
sampleStru.frequency=sampleSS.frequency; 

display('Saved model structures'); 
cd(model.path); 
save modelStructures names model KFStru sampleStru report; 
cd(cucd); 

